Press Events

Responding to Press Events

Generally, all responders which perform custom press handling should override all four of these methods. For each call to the pressesBegan:withEvent: method, your responder’s pressesEnded:withEvent: or pressesCancelled:withEvent: method is called. The pressesChanged:withEvent:

  • Sent to the receiver when a physical button is pressed in the associated view.

    Declaration

    SWIFT

    func pressesBegan(_ pressesSet<UIPress>,
            withEvent eventUIPressesEvent?)

    OBJECTIVE-C

    - (void)pressesBegan:(NSSet<UIPress *> *)presses
               withEvent:(UIPressesEvent *)event

    Parameters
    presses

    A set of UIPress instances in the event represented by event that represent the touches in the UIPressPhaseBegan phase.

    event

    UIPressesEvent object representing the event to which the presses belong.

    Availability

    Available in iOS 9.0 and later.

  • Sent to the receiver when a system event (such as a low-memory warning) cancels a press event.

    Declaration

    SWIFT

    func pressesCancelled(_ pressesSet<UIPress>,
                withEvent eventUIPressesEvent?)

    OBJECTIVE-C

    - (void)pressesCancelled:(NSSet<UIPress *> *)presses
                   withEvent:(UIPressesEvent *)event

    Parameters
    presses

    A set of UIPress instances in the event represented by event that represent the touches in the UIPressPhaseCancelled phase.

    event

    UIPressesEvent object representing the event to which the presses belong.

    Discussion

    If your app handles other press events, you must also handle cancelled press events. Failure to do so is very likely to lead to incorrect behavior or crashes.

    Availability

    Available in iOS 9.0 and later.

  • Sent to the receiver when the force of the press has changed in the associated view.

    Declaration

    SWIFT

    func pressesChanged(_ pressesSet<UIPress>,
              withEvent eventUIPressesEvent?)

    OBJECTIVE-C

    - (void)pressesChanged:(NSSet<UIPress *> *)presses
                 withEvent:(UIPressesEvent *)event

    Parameters
    presses

    A set of UIPress instances in the event represented by event that represent the touches in the UIPressPhaseChanged phase.

    event

    UIPressesEvent object representing the event to which the presses belong.

    Discussion

    The pressesChanged:withEvent: method is invoked for presses that provide an analog value, such as thumbsticks or analog push buttons.

    Availability

    Available in iOS 9.0 and later.

  • Sent to the receiver when a button is released from the associated view.

    Declaration

    SWIFT

    func pressesEnded(_ pressesSet<UIPress>,
            withEvent eventUIPressesEvent?)

    OBJECTIVE-C

    - (void)pressesEnded:(NSSet<UIPress *> *)presses
               withEvent:(UIPressesEvent *)event

    Parameters
    presses

    A set of UIPress instances in the event represented by event that represent the touches in the UIPressPhaseEnded phase.

    event

    UIPressesEvent object representing the event to which the presses belong.

    Availability

    Available in iOS 9.0 and later.

### 回答1: "events.out.tfevents" 是 TensorFlow 中的事件文件。它可以用 TensorFlow 的可视化工具 TensorBoard 来打开咟查看。 打开 TensorBoard 的方法是在命令行中运行 "tensorboard --logdir=path/to/events.out.tfevents",其中 "path/to/events.out.tfevents" 是事件文件的路径。 运行后会在终端中输出类似于 "TensorBoard 2.4.0 at http://(hostname):6006 (Press CTRL+C to quit)"的信息,打开对应的地址即可看到可视化结果。 ### 回答2: events.out.tfevents是TensorBoard的事件文件格式,用于存储训练过程中的事件数据。要打开这个文件,您需要使用TensorBoard工具。 要在TensorBoard中打开events.out.tfevents文件,您可以按照以下步骤操作: 1. 首先,确保您已经安装了TensorBoard。如果没有安装,您可以使用pip安装TensorBoard:`pip install tensorboard`。 2. 接下来,打开终端或命令提示符窗口,并导航到包含events.out.tfevents文件的目录。 3. 运行以下命令来启动TensorBoard服务器并打开events.out.tfevents文件: ``` tensorboard --logdir=. ``` 这将启动TensorBoard服务器,并将事件文件从当前目录加载到TensorBoard。 4. 在终端或命令提示符窗口上看到以下行时,表示TensorBoard服务器已在本地主机的默认端口(通常为6006)上启动: ``` TensorBoard 1.15.0 at http://localhost:6006/ (Press CTRL+C to quit) ``` 5. 在Web浏览器中打开http://localhost:6006/(或显示的端口)。 6. 这将显示TensorBoard的用户界面,您可以在其中查看事件文件的内容和摘要。您可以通过选择相应的标签和运行特定的命令,查看各种图表、标量、直方图等事件数据。 总结:通过以上步骤,您可以成功打开events.out.tfevents文件,并在TensorBoard中查看和分析其中的事件数据。 ### 回答3: events.out.tfevents是TensorFlow框架中存储的一个二进制日志文件,用于记录训练过程中的事件和摘要信息。它包含了模型的训练损失、准确率、梯度信息、学习率变化等重要信息,可以用作训练过程的可视化和分析。 要打开events.out.tfevents文件,通常需要使用TensorBoard工具。首先,需要确保TensorBoard已经安装在计算机上。然后,在命令行中执行以下命令: ``` tensorboard --logdir=events.out.tfevents所在的目录 ``` 这将启动TensorBoard服务器,并监听默认的6006端口。然后,可以通过在浏览器中输入localhost:6006来访问TensorBoard的用户界面。 在TensorBoard用户界面中,可以查看训练过程的各种指标的变化曲线,如损失函数、准确率等。还可以通过选择不同的标签和图表来查看特定变量的数据。此外,TensorBoard还提供了一些交互式工具,如放大缩小数据查看、数据筛选和保存结果等。 通过打开events.out.tfevents文件,可以更好地理解和分析深度学习模型的训练过程。在TensorBoard中,我们可以追踪训练过程中的变化趋势,优化模型的性能,并且能够改进和调整模型的参数。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值